﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="BGN.ActiveX.SInfoTest.Test" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript">
        window.onload = function () {
            try {
                //alert(document.getElementById("BGNActiveX"));
                document.getElementById("BGNActiveX").ConnectServer("127.0.0.1", 8989, 8990);
            } catch (e) {
                alert(e.message);
            }
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <object id='BGNActiveX' name='BGNActiveX' classid='clsid:8d7d8518-ca58-4863-b94d-3c616fda7b35'></object>
        <script ID="BgnActiveXCommandEvent" type="text/javascript" language="javascript" for="BGNActiveX" event="OnSystemComand2(sCommand)">
        try {
            alert(sCommand);
            var sFun = "(function(){"+ sCommand +"})();";
            eval(sFun);
        } catch (e) {
            alert(e);
        }
        </script>
    </div>
    </form>
</body>
</html>
